//
// Created by Administrator on 2023/2/1.
//去重复
// 按月取不同的日期(不考虑闰年)
//

#include <iostream>

using namespace std;

int main()
{
    int a, b, c, cf = 0;
    int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
    scanf("%d %d %d", &a, &b, &c);
    if (a == b and b == c)
    {
        cf = 1;
    }
    // yy-mm-dd
    if (0<b < 13)
    {
        if (0<c and c < days[b]+1)
        {
            if (a > 59)
            {
                printf("yy-mm-dd: %d %02d %02d\n", a + 1900, b, c);
            }
            if (a <= 59)
            {
                printf("yy-mm-dd: %d %02d %02d\n", a + 2000, b, c);
            }
        }
    }
    // mm-dd-yy
    if (a < 13 and a>0 and cf==0)
    {
        if (b < days[b]+1 and b>0)
        {
            if (c > 59)
            {
                printf("mm-dd-yy: %02d %02d %d\n", a, b, c + 1900);
            }
            if (c <= 59)
            {
                printf("mm-dd-yy: %02d %02d %d\n", a, b, c + 2000);
            }
        }
    }
    // dd-mm-yy
    if (b < 13 and b>0 and cf==0)
    {
        if (a < days[b]+1 and a>0)
        {
            if (c > 59)
            {
                printf("dd-mm-yy: %02d %02d %d\n", a, b, c + 1900);
            }
            if (c <= 59)
            {
                printf("dd-mm-yy: %02d %02d %d\n", a, b, c + 2000);
            }
        }
    }
}